<template>
    <div class="page rdsp-fix-botttom-page" data-page="goAppoint" style="z-index: 2;">
        <div class="link-page-nav">
            <a href="#" class="link" @click="$root.backToTab()">
                <i class="iconfont icon-zuo"></i>
            </a>
        </div>
        <div class="link-page-top" style="padding-bottom: 17px;">
            <div class="link-page-title">隐患指派</div>
            <div class="go-history-list">
                <a href="#" class="link" @click="attention">
                    <i class="iconfont icon--" id="noAttention_{{getNewId}}"
                       style="font-size: 23px;"></i>
                    <i class="iconfont icon--" id="attention_{{getNewId}}" style="font-size: 23px;display: none;"></i>
                </a>
            </div>
        </div>
        <div id="tb-modify-record_{{getNewId}}" class="page-content pdbottom100">
            <!--轮播图片-->
            <div id="hiddenCheck-swiper_{{getNewId}}" class="swiper-container">
                <div class="swiper-pagination" id="hiddenCheck_pagination_{{getNewId}}"></div>
                <div class="swiper-wrapper" id="hiddenCheck_swiper_{{getNewId}}"></div>
            </div>
            <div class="form-hiddenDanger" style="margin-left:23px;">
                <div class="rdsp-inner-content">
                    <div class="hiddenDanger-block" id="trouble-pai-people_{{getNewId}}">
                        <div class="right-con">
                            <div class="right-datail tb-appoint-person">由<span id="tb-person_{{getNewId}}"></span>指派
                            </div>
                        </div>
                    </div>
                    <div class="hiddenDanger-block">
                        <div id="troubledes_app_{{getNewId}}"></div>
                        <div class="right-con">
                            <div id="hiddenDangerDesc_{{getNewId}}" class="right-datail tb-appoint-detail"></div>
                        </div>
                    </div>
                    <div class="hiddenDanger-block">
                        <div class="right-con">
                            <div class="right-datail">
                                <i class="iconfont icon-dingweiweizhi" style="color:#2471CA;font-size: 14px;"></i>
                                <span class="tb-adds" id="tb-adds_{{getNewId}}"></span>
                            </div>
                        </div>
                    </div>
                    <div class="hiddenDanger-block">
                        <div class="right-con">
                            <div class="right-datail tb-create-info">
                                <div><img src="/ilink-app-h5-zd/static/img/rdspFile_1553591751238.png"
                                          class="appoint-tx-img"></div>
                                <div class="tb-sava-name" id="tb-sava-name_{{getNewId}}"></div>
                                <div class="appoint-create-time">创建于<span id="tb-sava-time_{{getNewId}}"></span></div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="divide-gray"></div>
            <div class="form-hiddenDanger">
                <div class="rdsp-inner-content each-option-line">
                    <div class="hiddenDanger-block">
                        <div class="left-title left-title-red fl">责任单位</div>
                        <div class="right-con  has-arrow">
                            <div id="tb-resUnit_{{getNewId}}" @click="select_unit"
                                 class="right-select right-datail disable"></div>
                            <i class="iconfont icon-zuo"></i>
                        </div>
                    </div>
                </div>
                <div class="rdsp-inner-content each-option-line">
                    <div class="hiddenDanger-block">
                        <div class="left-title fl">责任人</div>
                        <div class="right-con  has-arrow">
                            <div id="tb-respel_{{getNewId}}" class="right-select right-datail disable"></div>
                            <i class="iconfont icon-zuo"></i>
                        </div>
                    </div>
                </div>
                <div class="rdsp-inner-content each-option-line">
                    <div class="hiddenDanger-block">
                        <div class="left-title left-title-red fl">隐患等级</div>
                        <div class="right-con  has-arrow">
                            <div id="tb-level_{{getNewId}}" class="right-select right-datail disable"></div>
                            <i class="iconfont icon-zuo"></i>
                        </div>
                    </div>
                </div>
                <div class="rdsp-inner-content each-option-line">
                    <div class="hiddenDanger-block">
                        <div class="left-title left-title-red fl">隐患类型</div>
                        <div class="right-con  has-arrow">
                            <div id="tb-type_{{getNewId}}" class="right-select right-datail disable"></div>
                            <i class="iconfont icon-zuo"></i>
                        </div>
                    </div>
                </div>
                <div class="rdsp-inner-content each-option-line">
                    <div class="hiddenDanger-block">
                        <div class="left-title left-title-red fl">相关资产</div>
                        <div class="right-con  has-arrow">
                            <div id="tb-assts_{{getNewId}}" class="right-select right-datail"></div>
                        </div>
                    </div>
                </div>
                <div class="rdsp-inner-content each-option-line">
                    <div class="hiddenDanger-block">
                        <div class="left-title left-title-red fl" style="width: 100px;">相关物联设备</div>
                        <div class="right-con  has-arrow">
                            <div id="tb-eqSys_{{getNewId}}" class="right-select right-datail"></div>
                        </div>
                    </div>
                </div>
                <div class="rdsp-inner-content each-option-line">
                    <div class="hiddenDanger-block">
                        <div class="left-title left-title-red fl" style="width: 100px;">消防系统</div>
                        <div class="right-con  has-arrow">
                            <div id="tb-fireSys_{{getNewId}}" class="right-select right-datail"></div>
                        </div>
                    </div>
                </div>
                <div class="rdsp-inner-content each-option-line" id="tb-endtime_{{getNewId}}">
                    <div class="hiddenDanger-block">
                        <div class="left-title left-title-red fl">整改期限</div>
                        <div class="right-con  has-arrow">
                            <div id="tb-endtime-appoint_{{getNewId}}" class="right-select right-datail disable">
                                <span style='color:#999;'>请选择</span>
                            </div>
                            <i class="iconfont icon-zuo"></i>
                        </div>
                    </div>
                </div>
            </div>
            <div id="btn_footer_goAppoint_{{getNewId}}" class="btn_footer_goAppoint rdsp-fix-botttom goRectifica-footer"
                 style="position: relative;"><span @click="savaTbDetails">确认指派</span></div>
        </div>
    </div>
</template>
<style scoped>

    .disable {
        pointer-events: none;
    }

    .btn_footer_goAppoint {
        display: none;
    }

    .rdsp-fix-botttom {
        margin: 50px auto;
        margin-top: 80px;
    }

    .tb-appoint-person {
        color: #397FCF;
        font-size: 14px;
    }

    .tb-adds {
        font-size: 14px;
        color: #999999;
        margin-left: 4px;
        word-wrap: break-word;
        word-break: break-all;
    }

    .appoint-create-time {
        position: relative;
        top: -48px;
        left: 72px;
    }

    .tb-sava-name {
        position: relative;
        top: -52px;
        left: 71px;
        font-size: 16px;
        color: #333333;
    }

    .appoint-tx-img {
        width: 60px;
        height: 60px;
    }

    .wt90 {
        width: 90%;
        height: 211px;
        margin-left: 5%;
    }

    .tb-voice {
        width: 80px;
        height: 32px;
        background-color: #efefef;
        border-radius: 4px;
        line-height: 32px;
    }

    /* #isHasVoice,
    #isHasVoice_bh {
        display: none;
    } */

    .tb-voice-png {
        width: 12px;
    }

    .tb-voice-after {
        width: 100%;
        height: 35px;
        line-height: 35px;
    }

    .tb-voice-after-time {
        width: 100%;
        height: 100%;
        color: #fff;
        text-align: left;
        float: left;
        background: #378bf6;
    }

    .tb-voice-gif {
        height: 16px !important;
        width: 13px !important;
        margin: 3px;
    }

    .tb-voice-png {
        height: 16px !important;
        width: 13px !important;
        margin: 8px;
    }

    .demo-swiper .swiper-slide {
        font-size: 25px;
        font-weight: 300;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #fff;
        color: #333333;
    }

    .demo-swiper .swiper-slide {
        box-sizing: border-box;
        /* border: 1px solid #ddd; */
        background: #fff;
    }

    .demo-swiper {
        margin: 0px 0 35px;
        font-size: 18px;
        height: 200px;
    }

    .demo-swiper.demo-swiper-auto .swiper-slide {
        width: 85%;
    }

    .demo-swiper.demo-swiper-auto .swiper-slide:nth-child(2n) {
        width: 70%;
    }

    .demo-swiper.demo-swiper-auto .swiper-slide:nth-child(3n) {
        width: 30%;
    }

    .rdsp-inner-content.each-option-line {
        height: 25px;
    }

    .every-hidden-list {
        width: 100%;
        height: 200px;
        /* margin: 0 20px; */
    }
</style>
<script>
    return {
        mounted() {
            var self = this;
            var $ = self.$;
        },
        beforeCreate() {
            var self = this;
            var $ = self.$;
        },
        data: function () {
            return {
                tbId: '',
                touBgrade: {}, //全部等级
                touBValueObj: {}, //全部类别
                userObj: {}, //联网单位下人员
                endTimeType: 0, //整改期限
                troubleRank: 0, //等级id
                categoryId: 0, //类别id
                currentOrgId: 0, //责任单位id
                currentOrgName: '', //责任单位名称
                hiddenDangerId: 0, //隐患整改id
                createAccount: '', //创建人账户
                chargePerson: '', //责任人
                details: '', //改条隐患详细信息
                isShow: true,
                touBType: [],
                gifPath: staticPath + "img/apply/voicePlay.gif",
                imgPath: staticPath + "img/apply/voicePlay.png",
                noimgPath: staticPath + "img/apply/novoicePlay.png",
                dshiqi: null,
                isCollect: null,
                getNewId: (new Date()).getTime(),
            }
        },
        methods: {
            addRectification: function () {
                // 联网单位id 隐患整改id 创建人账户 隐患等级id 隐患类型id
                app.router.navigate("/addRectification/" + this.currentOrgId + "/" + this.hiddenDangerId + "/" +
                    this.createAccount + "/" + this.troubleRank + "/" + this.categoryId + "/");
            },
            //关注
            attention: function () {
                var self = this;
                var $ = self.$;
                if (self.isCollect == 1) { // 取消关注
                    app.params.dialog.buttonCancel = "取消";
                    app.params.dialog.buttonOk = "确认";
                    app.dialog.confirm('确认取消关注此隐患?', '确认', function () {
                        common.loading(1);
                        Dao.focusOnOff({
                            userAccount: userInfor.accountName,
                            type: "5",
                            userName: userInfor.accountName,
                            concemId: self.$route.params.id
                        }, function (data) {
                            common.loading(0);
                            self.isCollect = 0;
                            $("#noAttention_" + self.getNewId).css("color", "#333333");
                            $("#attention_" + self.getNewId).hide();
                            $("#noAttention_" + self.getNewId).show();
                            app.methods.showToastCenter("取消关注成功");
                        }, function (e) {
                            common.loading(0);
                            app.methods.showToastCenter("取消关注失败");
                        });
                    });
                } else {
                    common.loading(1);
                    Dao.addUserConcem({
                        userAccount: userInfor.accountName,
                        type: "5",
                        concemId: self.$route.params.id,
                        userName: userInfor.accountName
                    }, function (data) {
                        common.loading(0);
                        self.isCollect = 1;
                        $("#attention_" + self.getNewId).css("color", "red");
                        $("#noAttention_" + self.getNewId).hide();
                        $("#attention_" + self.getNewId).show();
                        app.methods.showToastCenter("关注成功");
                    }, function (e) {
                        common.loading(0);
                        app.methods.showToastCenter("关注失败");
                    });
                }
            },
            savaTbDetails: function () {
                var self = this;

                if (self.troubleRank == null) {
                    app.methods.showToastCenter("请选择隐患等级");
                    return;
                }
                if (self.categoryId == null) {
                    app.methods.showToastCenter("请选择隐患类别");
                    return;
                }
                if (self.chargePerson == '') {
                    app.methods.showToastCenter("请选择责任人");
                    return;
                }
                if (!self.endTimeStr) {
                    app.methods.showToastCenter("请选择整改期限");
                    return;
                }

                common.loading(1);
                Dao.saveHidDanger({
                    id: self.details.id,
                    orgId: self.currentOrgId,
                    categoryId: self.categoryId,
                    gradeId: self.troubleRank,
                    createAccount: self.details.createAccount,
                    chargePerson: self.chargePerson,
                    status: 1,
                    endTimeStr: self.endTimeStr,
                    relateAssetsIds: self.details.relateAssetsIds, //资产
                    relateFcfIds: self.details.relateFcfIds, //物联设备
                }, function (data) {
                    common.loading(0);
                    Dao.troubleback({
                        orgId: self.details.orgId,
                        hiddenDangerId: self.details.id,
                        picUrls: self.details.picUrls,
                        type: 3,
                        gradeId: self.troubleRank,
                        categoryId: self.categoryId,
                        status: 1,
                        createAccount: userInfor.accountName
                    }, function (data) {
                        common.loading(0);
                        app.methods.showToastCenter('指派成功');
                        app.methods.backToTab();
                        // app.router.back();
                        // jQuery(".troubleApply-type div").eq(0).click();
                        // app.view.current.el.f7View.router.currentPageEl.f7Component.getHiddenNum();
                    });
                });
            },

            select_unit: function () {
                var self = this;
                if (userInfor.isMuilUnitUser == 0) {
                    return;
                }
                loadSelectUnitFunc(function (data) {
                    $("#tb-resUnit_" + self.getNewId).html(data.orgName);
                    self.currentOrgId = data.orgId;
                    self.currentOrgName = data.orgName;
                });
            },
            htmlGetUnitUsers: function (orgId) {
                var self = this;
                //人员名单
                let selectOptionIndex1 = null;
                let selectOptionType = null;
                jQuery("#tb-respel_" + self.getNewId).click(function (e) {
                    getFourTypeUser(self.currentOrgId, function (data) {
                        jQuery("#tb-respel_" + self.getNewId).html(data.name);
                        if (self.isShow && data.id != self.chargePerson) {
                            // $(".goRectifica-footer").children()[0].style.width = '47%';
                            // $(".goRectifica-footer").children()[1].style.display = 'block'
                            self.isShow = false;
                        }
                        self.chargePerson = data.id;

                        if (selectOptionIndex1 != data.index) {
                            selectOptionIndex1 = data.index;
                            selectOptionType = data.type;
                        } else {
                            selectOptionIndex1 = "";
                            selectOptionType = 1;
                        }
                    }, selectOptionIndex1, selectOptionType);
                });
            },

            initTbPiker: function () {
                var self = this;
                //等级
                Dao.getDict({
                    userName: userInfor.accountName,
                    deviceId: appKeyObj.deviceId,
                    code: 49,
                }, function (data) {
                    if (data.dictValueObj && data.dictValueObj.length > 0) {
                        var touBType = [];
                        var result = data.dictValueObj;
                        for (var i = 0; i < result.length > 0; i++) {
                            var obj = {};
                            obj.id = result[i].dictKey;
                            obj.name = result[i].dictValue;
                            touBType.push(obj);
                        }
                        //隐患等级
                        let selectOptionIndex = null;
                        jQuery("#tb-level_" + self.getNewId).click(function (e) {
                            selectOptionFn(touBType, function (data) {
                                jQuery("#tb-level_" + self.getNewId).html(data.name);
                                if (self.isShow && data.id != self.troubleRank) {
                                    // $(".goRectifica-footer").children()[0].style.width = '47%';
                                    // $(".goRectifica-footer").children()[1].style.display = 'block'
                                    self.isShow = false;
                                }
                                self.troubleRank = data.id;
                                if (selectOptionIndex != data.index) {
                                    selectOptionIndex = data.index;
                                } else {
                                    selectOptionIndex = "";
                                }
                            }, selectOptionIndex);
                        });
                    }
                });
                //类型
                Dao.getDict({
                    userName: userInfor.accountName,
                    deviceId: appKeyObj.deviceId,
                    code: 50,
                }, function (data) {
                    if (data.dictValueObj && data.dictValueObj.length > 0) {
                        var touBType = [];
                        var json = JSON.parse(data.dictValueObj[0].dictValue);
                        for (var i = 0; i < json.length > 0; i++) {
                            var obj = {};
                            obj.id = json[i].id;
                            obj.name = json[i].text;
                            touBType.push(obj);
                        }
                        //隐患等级
                        let selectOptionIndex3 = "";
                        jQuery("#tb-type_" + self.getNewId).click(function (e) {
                            selectOptionFn(touBType, function (data) {
                                jQuery("#tb-type_" + self.getNewId).html(data.name);
                                if (self.isShow && data.id != self.categoryId) {
                                    // $(".goRectifica-footer").children()[0].style.width = '47%';
                                    // $(".goRectifica-footer").children()[1].style.display = 'block'
                                    self.isShow = false;
                                }
                                self.categoryId = data.id;
                                if (selectOptionIndex3 != data.index) {
                                    selectOptionIndex3 = data.index;
                                } else {
                                    selectOptionIndex3 = "";
                                }
                            }, selectOptionIndex3, 1);
                        });
                    }
                });
                //整改期限
                var dateType = [];
                var dateResylt = [];
                dateResylt.push({
                    "id": 1,
                    "text": "24小时"
                });
                dateResylt.push({
                    "id": 2,
                    "text": "5个工作日"
                });
                dateResylt.push({
                    "id": 3,
                    "text": "10个工作日"
                });
                dateResylt.push({
                    "id": 4,
                    "text": "30个工作日"
                });
                dateResylt.push({
                    "id": 5,
                    "text": "3个月内"
                });
                dateResylt.push({
                    "id": 6,
                    "text": "半年内"
                });
                for (var i = 0; i < dateResylt.length > 0; i++) {
                    var obj = {};
                    obj.id = dateResylt[i].id;
                    obj.name = dateResylt[i].text;
                    dateType.push(obj);
                }
                let selectOptionIndex = null;
                var orginalEndTime = null;
                var genzaiEndTime = null;
                var orginalEndDate = null;
                jQuery("#tb-endtime-appoint_" + self.getNewId).click(function (e) {
                    if (!orginalEndTime) {
                        orginalEndTime = jQuery("#tb-sava-time_" + self.getNewId).html();
                    }
                    if (!genzaiEndTime) {
                        genzaiEndTime = jQuery("#tb-endtime-appoint_" + self.getNewId).html();
                    }
                    orginalEndDate = moment(orginalEndTime);
                    selectOptionFn(dateType, function (data) {
                        orginalEndDate = moment(orginalEndTime);
                        if (self.endTimeType == data.id) {
                            $("#tb-endtime-appoint_" + self.getNewId).removeClass("select_color");
                            jQuery("#tb-endtime-appoint_" + self.getNewId).html(genzaiEndTime);
                            self.endTimeType = 0;
                        } else {
                            if ("1" === data.id) {
                                orginalEndDate.add(1, "days");
                            } else if ("2" === data.id) {
                                orginalEndDate.add(5, "days");
                            } else if ("3" === data.id) {
                                orginalEndDate.add(10, "days");
                            } else if ("4" === data.id) {
                                orginalEndDate.add(30, "days");
                            } else if ("5" === data.id) {
                                orginalEndDate.add(3, "months");
                            } else if ("6" === data.id) {
                                orginalEndDate.add(6, "months");
                            }
                            jQuery("#tb-endtime-appoint_" + self.getNewId).html(orginalEndDate.format("YYYY-MM-DD HH:mm"));
                            self.endTimeStr = orginalEndDate.format("YYYY-MM-DD HH:mm:ss")
                            $("#tb-endtime-appoint_" + self.getNewId).addClass("select_color");
                            self.endTimeType = data.id;
                            if (self.isShow && data.id != self.selectOptionIndex) {
                                //$(".goRectifica-footer").children()[0].style.width = '47%';
                                //$(".goRectifica-footer").children()[1].style.display = 'block'
                                self.isShow = false;
                            }
                        }
                        if (selectOptionIndex != data.index) {
                            selectOptionIndex = data.index;
                        } else {
                            selectOptionIndex = "";
                        }
                    }, selectOptionIndex);
                });
            },
            htmlGetHidDanger: function (selectId) {
                var self = this;
                var hiddenDangerId = self.$route.params.id;
                if (selectId) {
                    hiddenDangerId = selectId;
                }
                Dao.getHidDanger({
                    account: userInfor.accountName,
                    hiddenDangerId: hiddenDangerId,
                }, function (data) {
                    showVoiceBtn("#troubledes_app_" + self.getNewId, data.voiceLength, data.hiddenDangerVoice);
                    if (userInfor.accountName == data.managerPerson) {
                        jQuery("#btn_footer_goAppoint_" + self.getNewId).show();
                        jQuery("#tb-resUnit_" + self.getNewId).removeClass("disable");
                        jQuery("#tb-respel_" + self.getNewId).removeClass("disable");
                        jQuery("#tb-level_" + self.getNewId).removeClass("disable");
                        jQuery("#tb-type_" + self.getNewId).removeClass("disable");
                        jQuery("#tb-endtime-appoint_" + self.getNewId).removeClass("disable");
                    } else {
                        jQuery("#btn_footer_goAppoint_" + self.getNewId).hide();
                    }
                    var flag = false;
                    var image = "";
                    $("#hiddenCheck_swiper_" + self.getNewId).empty();
                    if (data.picUrls != null && data.picUrls != '') {
                        image = data.picUrls.split(',');
                        if (image.length > 1) {
                            flag = true;
                        }
                        for (var i = 0; i < image.length; i++) {
                            if(image[i].substr(image[i].length - 3) === 'mp4' || image[i].substr(image[i].length - 3) === '3gp' || image[i].substr(image[i].length - 4) === 'mpeg' || image[i].substr(image[i].length - 6) === 'mavip4' || image[i].substr(image[i].length - 3) === 'flv' || image[i].substr(image[i].length - 3) === 'mov'){
                                $("#hiddenCheck_swiper_" + self.getNewId).append(`<div class="swiper-slide every-hidden-list" data-index="`+i+`" style="background:url(` + staticPath + `img/common/video_list_detail.png` + `) center no-repeat;background-size: cover;margin: 0 23px;width: calc(100% - 46px);"></div>`)
                            }else{
                                $("#hiddenCheck_swiper_" + self.getNewId).append(`<div class="swiper-slide every-hidden-list" data-index="`+i+`" style="background:url(` + image[i] + `) center no-repeat;background-size: cover;"></div>`);
                            }
                        }
                        app.lazy.create("#hiddenCheck_swiper_" + self.getNewId);
                        jQuery("#hiddenCheck_swiper_" + self.getNewId).off('click').on('click', {'data': image}, function (e) {
                            // let target = e.target.style.backgroundImage.slice(5, -2);
                            // let index = e.data.data.indexOf(target);
                            openAndShowBigImage(e.data.data, Number(e.target.dataset.index));
                        });
                        if (flag) {
                            var hiddenCheck_swiper = new Swiper('#hiddenCheck-swiper_' + self.getNewId, {
                                direction: 'horizontal',
                                loop: false,
                                slidesPerView: "auto",
                                pagination: {
                                    el: '.swiper-pagination'
                                }
                            });
                        }
                    }
                    self.troubleRank = data.gradeId;
                    self.categoryId = data.categoryId;
                    self.currentOrgId = data.orgId;
                    self.hiddenDangerId = data.id;
                    self.createAccount = data.createAccount;
                    self.chargePerson = data.chargePerson;
                    self.endTime = data.endTime;
                    self.details = data;
                    self.htmlGetUnitUsers();
                    self.isCollect = data.isCollect;
                    if (self.isCollect === 1) { // 关注
                        $("#attention_" + self.getNewId).css("color", "red");
                        $("#attention_" + self.getNewId).show();
                        $("#noAttention_" + self.getNewId).hide();
                    }
                    //切换了责任单位，原单位用户从消息点击过来判断
                    var orgIds = userInfor.organizationIds.split(',');
                    if (-1 === jQuery.inArray(self.currentOrgId.toString(), orgIds)) {
                        jQuery("#btn_footer_goAppoint_" + self.getNewId).hide();
                        jQuery("#btn_footer_goAppoint_" + self.getNewId).parent().css("padding-bottom", '0px');
                    }
                    //指派人
                    if (data.managerPerson && data.managerPersonName) {
                        $("#trouble-pai-people_" + self.getNewId).show();
                        $("#tb-person_" + self.getNewId).html(data.managerPersonName).show();
                    } else {
                        $("#trouble-pai-people_" + self.getNewId).hide();
                    }

                    $("#tb-sava-name_" + self.getNewId).html(common.transNullundefinedToline(data.createAccountName));//创建人
                    $("#tb-sava-time_" + self.getNewId).html(common.transNullundefinedToline(common.getTimeToyyyymmddhhmm(data.createTime)));  //创建时间
                    $("#tb-adds_" + self.getNewId).html(common.transNullundefinedToline(data.addrDesc));
                    $("#hiddenDangerDesc_" + self.getNewId).html(self.transNoData(data.hiddenDangerDesc));  //责任单位
                    $("#tb-respel_" + self.getNewId).html(self.transNoData(data.chargePersonName));  //责任人
                    $("#tb-level_" + self.getNewId).html(self.transNoData(data.gradeName));  //隐患等级
                    $("#tb-type_" + self.getNewId).html(self.transNoData(data.categoryName));  //隐患类型
                    $("#tb-assts_" + self.getNewId).html(common.transNullundefinedToline(data.relateAssetsNames));
                    $("#tb-eqSys_" + self.getNewId).html(common.transNullundefinedToline(data.relateFcfNames));
                    $("#tb-fireSys_" + self.getNewId).html(common.transNullundefinedToline(data.systemName));
                    $("#tb-resUnit_" + self.getNewId).html(common.transNullundefinedToline(data.orgName));
                });
            },
            //空数据转换
            transNoData(value) {
                if (value) {
                    return value;
                } else {
                    return "<span style='color:#999;'>请选择</span>"
                }
            }
        },
        on: {
            pageInit: function (e, page) {
                this.initTbPiker();
                if (userInfor.isMuilUnitUser == 0) {
                    $('#tb-resUnit_' + self.getNewId).next().css('display', 'none');
                }
            },
            pageBeforeIn: function (e, page) {
                this.htmlGetHidDanger();
            },
            pageAfterIn: function (e, page) {
                var self = this;
                var $ = self.$;
                if (1 == indexHiddenDangerStatus) {
                    common.loading(1);
                    setTimeout(function () {
                        if (indexFlag == 0) {
                            indexHiddenDangerStatus = 0;
                            indexFlag = 0;
                            app.router.back();
                        } else {
                            indexHiddenDangerStatus = 0;
                            indexFlag = 0;
                            app.methods.backToTab();
                        }
                        common.loading(0);
                    }, 50);
                } else {

                }
                // jQuery(".form-hiddenDanger .rdsp-inner-title").click(function (e) {
                //     jQuery(e.currentTarget).parent().toggleClass("show");
                //     jQuery(e.currentTarget).siblings(".rdsp-inner-content").slideToggle();
                // });
            },
        }
    }
</script>
